<?php
/**
 * Created by PhpStorm.
 * User: jswei
 * Date: 2018/5/3
 * Time: 14:03
 */
namespace app\first\validate;

use think\Validate;

class Article extends Validate{
    protected $rule = [
        'title'=>'require',
        'cid'=>'require',
        'keywords'=>'require',
        'content'=>'require',
        'cover'=>'require',
    ];
    protected $message = [
        'title.require'=>'请填写帖子标题',
        'cid.require'=>'请选择帖子栏目',
        'content.require'=>'请填写帖子内容',
        'cover.require'=>'请填写帖子封面图',
    ];
    public function sceneQuery(){
        return $this->only(['id'])
            ->append('id', 'require|integer');
    }
    public function sceneDelete(){
        return $this->only(['id'])
            ->append('id', 'require|integer');
    }
}